From 32d2a13b8082e30b187403bbfc70ec54be3174d6 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Wed, 25 Jun 2008 21:15:37 +0000 Subject: [PATCH] destinator: Use new unicode functions of CET lib. --- destinator.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/destinator.c b/destinator.c index 60a71f232..7ddac676c 100644 --- a/destinator.c +++ b/destinator.c @@ -24,6 +24,7 @@ #include "defs.h" #include "cet.h" +#include "cet_util.h" #include "garmin_fs.h" #include "strptime.h" #include @@ -97,17 +98,12 @@ read_wcstr(const int discard) static void write_wcstr(const char *str) { - if (str && *str) { - int bytes, value; - char *cin = (char *)str; - char *ce = cin + strlen(cin); - while (cin < ce) { - cet_utf8_to_ucs4(cin, &bytes, &value); - cin += bytes; - gbfputint16(value, fout); - } - } - gbfputint16(0, fout); + int len; + short *unicode; + + unicode = cet_str_utf8_to_uni(str, &len); + gbfwrite((void *)unicode, 2, len + 1, fout); + xfree(unicode); } static int -- 2.30.2